package net.url;

import java.applet.Applet;
import java.awt.GridLayout;
import java.net.MalformedURLException;
import java.net.URL;

public class RelativeURLTest extends Applet
{
	
	private static final long	serialVersionUID	= 2756911322674042733L;

	@Override
	public void init()
	{
		URL base;
		try
		{
			base = new URL("http://www.baidu.com:80/helo.html?s=1#111");
			this.setLayout(new GridLayout(2,1));
			System.out.println(base.toString());
			System.out.println(base.getProtocol());
			System.out.println(base.getHost());
			System.out.println(base.getPort());
			System.out.println(base.getDefaultPort());
			System.out.println(base.getFile());
			System.out.println(base.getPath());
			System.out.println(base.getRef());
			System.out.println(base.getQuery());
			System.out.println(base.getUserInfo());
			System.out.println(base.getAuthority());
			
		}
		catch (MalformedURLException e1)
		{
			e1.printStackTrace();
		}
		
	}
}
